package com.bw.module_home.model.api

import com.bw.lib_net.entity.ResponseEntity
import com.bw.module_home.model.entity.CommentEntity
import retrofit2.http.*

/**
 * @Author : ZhouZiYao
 * @Time : On 2023/11/29 11:22
 * @Description :
 */
interface CommentApi {
    /**
     * 根据id获取评论信息方法
     * Returns 评论实体对象列表
     */
    @GET("/comment/getCommentByUserId")
    suspend fun getCommentById(@Query("datatype") datatype:Int, @Query("itemid") itemid:String?):ResponseEntity<MutableList<CommentEntity>>

    /**
     * 发布评论
     */
    @POST("/comment/publishComment")
    suspend fun publishComment(@Body entity: CommentEntity) : ResponseEntity<CommentEntity>

    /**
     * 删除评论
     */
    @DELETE("/comment/removeComment")
    suspend fun removeComment(@Query("id") id:Int):ResponseEntity<Boolean>

    /**
     * 点赞评论
     */
    @POST("/comment/agree")
    suspend fun agree(@Query("commentid") commentid:Int) :ResponseEntity<Boolean>

    /**
     * 取消点赞
     */
    @POST("/comment/unAgree")
    suspend fun unAgree(@Query("commentid") commentid:Int) :ResponseEntity<Boolean>
}